package design.pattern.Builder;

/**
 * rocket mq 的 properties的属性文件
 *
 * @author lihh
 */
public class RocketMQProperties {
  private String address;
  private int port;
  
  @Override
  public String toString() {
    return "RocketMQProperties{" +
        "address='" + address + '\'' +
        ", port=" + port +
        '}';
  }
  
  private RocketMQProperties(String address, int port) {
    this.address = address;
    this.port = port;
  }
  
  public static RocketMQPropertiesBuilder builder() {
    return new RocketMQPropertiesBuilder();
  }
  
  
  public static class RocketMQPropertiesBuilder {
    private String name;
    private int port;
    
    public RocketMQPropertiesBuilder name(String name) {
      this.name = name;
      return this;
    }
    
    public RocketMQPropertiesBuilder port(int port) {
      this.port = port;
      return this;
    }
    
    public RocketMQProperties build() {
      return new RocketMQProperties(this.name, this.port);
    }
  }
}
